def list_sort(*args, sort='desc'):
    """
        列表排序
    :param args: 列表
    :param sort: 排序方式 desc降序;asc升序
    :return:
    """
    args = list(args)
    for i in range(0, len(args) - 1):
        for j in range(i + 1, len(args)):
            if sort == 'desc':
                if args[i] < args[j]:
                    args[i], args[j] = args[j], args[i]
            else:
                if args[i] > args[j]:
                    args[i], args[j] = args[j], args[i]
    return args


print(list_sort(*[1, 13, 453, 3, 9, 434], sort='desc'))
print(list_sort(1, 13, 453, 3, 9, 434, sort='asc'))
